package him.action.factory;

import him.action.Action;
import him.action.ActionFactory;
import him.action.coursemanage.SubjectDeleteAction;
import him.action.coursemanage.SubjectDetailAction;
import him.action.coursemanage.SubjectInsertAction;
import him.action.coursemanage.SubjectInsertBfAction;
import him.action.coursemanage.SubjectListAction;
import him.action.coursemanage.SubjectUpdateAction;
import him.action.coursemanage.SubjectUpdateBfAction;
import him.action.coursemanage.course.CourseDeleteAction;
import him.action.coursemanage.course.CourseDetailAction;
import him.action.coursemanage.course.CourseInsertAction;
import him.action.coursemanage.course.CourseInsertBfAction;
import him.action.coursemanage.course.CourseListAction;
import him.action.coursemanage.course.CourseStuListAction;
import him.action.coursemanage.course.CourseStuUpdateAction;
import him.action.coursemanage.course.CourseUpdateAction;
import him.action.coursemanage.course.CourseUpdateBfAction;

public class CourseActionFactory implements ActionFactory {
	private static CourseActionFactory factory;
	
	public static CourseActionFactory getInstance(){
		if (factory==null) {
			factory=new CourseActionFactory();
		}
		return factory;
	}
	
	@Override
	public Action getAction(String command) {
		Action action = null;
		if (command.equalsIgnoreCase("subjectlist")) {
			action = new SubjectListAction();
		}else if (command.equalsIgnoreCase("subjectdetail")) {
			action = new SubjectDetailAction();
		}else if (command.equalsIgnoreCase("subjectinsert")) {
			action = new SubjectInsertAction();
		}else if (command.equalsIgnoreCase("subjectinsertbf")) {
			action = new SubjectInsertBfAction();
		}else if (command.equalsIgnoreCase("subjectupdate")) {
			action = new SubjectUpdateAction();
		}else if (command.equalsIgnoreCase("subjectupdatebf")) {
			action = new SubjectUpdateBfAction();
		}else if (command.equalsIgnoreCase("subjectdelete")) {
			action = new SubjectDeleteAction();
		}else if (command.equalsIgnoreCase("courselist")) {
			action = new CourseListAction();
		}else if (command.equalsIgnoreCase("coursedetail")) {
			action = new CourseDetailAction();
		}else if (command.equalsIgnoreCase("courseinsertbf")) {
			action = new CourseInsertBfAction();
		}else if (command.equalsIgnoreCase("courseinsert")) {
			action = new CourseInsertAction();
		}else if (command.equalsIgnoreCase("courseupdatebf")) {
			action = new CourseUpdateBfAction();
		}else if (command.equalsIgnoreCase("courseupdate")) {
			action = new CourseUpdateAction();
		}else if (command.equalsIgnoreCase("coursedelete")) {
			action = new CourseDeleteAction();
		}else if (command.equalsIgnoreCase("coursestulist")) {
			action = new CourseStuListAction();
		}else if (command.equalsIgnoreCase("coursestuupdate")) {
			action = new CourseStuUpdateAction();
		}
		return action;
	}

}
